
package com.hui.admin.common.exception;

import com.hui.admin.common.enums.ErrorCodeEnum;
import lombok.Getter;

/**
 * 用户自定义异常
 */
@Getter
public class UserException extends RuntimeException {

    private final String errorCode;

    public UserException(ErrorCodeEnum errorCode) {
        super(errorCode.getMessage());
        this.errorCode = errorCode.getCode();
    }

    public UserException(String errorMessage, String errorCode) {
        super(errorMessage);
        this.errorCode = errorCode;
    }
}
